@echo off

IF "%1"=="-help" goto help

if not exist %windir%\Microsoft.NET goto nodotnet

:setupbegin
if exist "%PROGRAMFILES%\Microsoft SDKs\Windows\v6.0A\bin\" set sdkpath=%PROGRAMFILES%\Microsoft SDKs\Windows\v6.0A\bin
if exist %windir%\Microsoft.NET\v2.0.50727 goto frameworkv2
if exist %windir%\Microsoft.NET\v3.5 goto frameworkv35

:frameworkv2
set frameworkpath=%windir%\Microsoft.NET\v2.0.50727
path %frameworkpath%;%sdkpath%;%path%
IF "%1"=="v2" goto exit
IF "%1"=="" goto frameworkv35

:frameworkv35
set frameworkpath=%windir%\Microsoft.NET\v3.5
path %frameworkpath%;%sdkpath%;%path%
goto exit

:nodotnet
echo "Error: .NET framework is not installed!"
goto exit

:help
echo An utility to find and set path variables for the .net framework
echo parameters:
echo            v2  -> sets the used framework version to 2.0
echo            v35 -> sets the used framework version to 3.5
goto exit

:exit
echo .NET Framework Path:  %frameworkpath%
echo Windows SDK Path:     %sdkpath%